home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 2
/
United Public Domain Gold 2.iso
/
utilities
/
pu426.dms
/
pu426.adf
/
PGEN
< prev
next >
Wrap
Text File
|
1992-06-07
|
6KB
|
277 lines
curdsk=1
colour=1
yyval=12
skipdel=0
cpytitl:dc.b "Lockpick Fast Copier Request",0
cpyques:dc.b "Do you need a copy of the original?",0
copyrst:dc.b "Proceeding with Fast Copy of remaining disks...",0
frqtitl:dc.b "Move to destination path... ",0
frqpath:ds.b 256,0
renpath:ds.b 256,0
frqname:ds.b 32,0
nxtdskm:dc.b "Copy disk "
dskm1: dc.b "00 of "
dskm2: dc.b "00?",0
slash: dc.b "/",0
diskdf1:dc.b "DF",0
diskdf2:dc.b "df",0
num00: dc.b "0"
num03: dc.b "3"
cmp hdonly,0,2,goto dofreq
docopy=simplereq(cpytitl,cpyques)
cmp docopy,0,0,goto dofreq
connect=drives()
cmp connect,-1,0,goto byebye
poke(fname+2,connect+48)
poke(rename+2,connect+48)
poke(remdsk+19,connect+48)
poke(insdsk2+6,connect+48)
drivenum=fcopy(connect,0)
cmp drivenum,0,-1,goto byebye
goto fixdev
dofreq: freturn=freq(frqtitl,frqpath,frqname,1)
cmp freturn,0,0,goto byebye
fixdev: pathlen=strlen(frqpath)
cmp pathlen,0,0,goto cpynam
pathlen=pathlen+frqpath-1
terminator=^pathlen>24
cmp terminator,58,0,goto cpynam1
cmp terminator,47,0,goto cpynam1
strcat(frqpath,slash)
cpynam1:strcpy(renpath,frqpath)
strcat(frqpath,fname+4)
strcat(renpath,rename+4)
goto chkdf
cpynam: strcat(frqpath,fname)
strcat(renpath,rename)
chkdf: sc=memcmp(frqpath,diskdf1,2)
cmp sc,0,0,goto fixxx
sc=memcmp(frqpath,diskdf2,2)
cmp sc,0,2,goto start
fixxx: sc=memcmp(frqpath+2,num00,1)
cmp sc,0,-1,goto start
sc=memcmp(frqpath+2,num03,1)
cmp sc,0,1,goto start
drivenum=frqpath+2
drivenum=^drivenum>24
poke(remdsk+19,drivenum)
poke(insdsk2+6,drivenum)
drivenum=drivenum-48
connect=drivenum<16+drivenum
freturn=0
exist: dc.b "Patch file already exists!",0
fnf: dc.b "File not found! Attempting Disk Scan...",0
fnf1: dc.b "File not found!",0
pnf: dc.b "Protection not found! Attempting Disk Scan!",0
pnf1: dc.b "Protection not found!",0
pnf2: dc.b "*** PARAMETER FAILED! ***",0
worktxt:dc.b "Working, please stand by...",0
clickany:dc.b "Click in this window to exit...",0
prof: dc.b "*** Parameter Successful! ***",0
remdsk: dc.b "Remove disk from DF0: then click in this window...",0
insdsk: dc.b "Insert BACKUP of",0
insdsk2:dc.b " in DF0: then click in this window...",0
dc.w 0
oritab: dc.l orig1,fix1,orig2,fix2,orig3,fix3,orig4,fix4,orig5,fix5
dc.l orig6,fix6,orig7,fix7,orig8,fix8,orig9,fix9
dc.l orig10,fix10,orig11,fix11,orig12,fix12,orig13,fix13
dc.l orig14,fix14,orig15,fix15,orig16,fix16,orig17,fix17
dc.l orig18,fix18,orig19,fix19,orig20,fix20,orig21,fix21
dc.l orig22,fix22,orig23,fix23,orig24,fix24,orig25,fix25
dc.l orig26,fix26,orig27,fix27,orig28,fix28,orig29,fix29
dc.l orig30,fix30,orig31,fix31,orig32,fix32,orig33,fix33
dc.l orig34,fix34,orig35,fix35,orig36,fix36,orig37,fix37
dc.l orig38,fix38,orig39,fix39,orig40,fix40,orig41,fix41
dc.l orig42,fix42,orig43,fix43,orig44,fix44,orig45,fix45
dc.l 0,0
* Open Window and print intro text...
start: cmp ^winname,"con:",0,winname=winname+18
pokel(wtitle,winname)
gosub openwin
cmp docopy,1,0,goto main
cmp freturn,-1,0,goto main
gosub remm
txtptr=insdsk
gosub print3d
txtptr=dname
colour=3
gosub print3d
txtptr=insdsk2
colour=1
gosub print3d
gosub waitsgn
cmp class,$200000,2,goto chkclow
cmp code,$1b,0,goto remprta
chkclow:cmp class,$200,0,goto remprta
skipdel=1
main: txtptr=worktxt
gosub print3d
cmp skipdel,0,2,goto begit
cmp freturn,-1,0,goto begit
delay(100)
begit: success=rename(frqpath,renpath)
cmp success,0,0,goto errexists
myhand=open(frqpath,1006)
cmp myhand,0,0,goto errexists
write(myhand,pst,pend-pst)
close(myhand)
pos=0
pointer=oritab
looper: orig=^pointer
pointer=pointer+4
fix=^pointer
pointer=pointer+4
pval=^pointer
cmp pval,0,0,top=garbage
cmp pval,0,2,top=pval
* Scan file for our string and replace if found...
pos=fscan(renpath,orig,fix-orig,fix,top-fix,pos)
cmp pos,-1,0,goto errpnf
cmp pos,-2,0,goto errfnf
cmp pval,0,2,goto looper
itsok: txtptr=prof
gosub print3d
delay(100)
cmp note1,0,0,goto ky1
colour=3
txtptr=note1
gosub print3d
cmp note2,0,0,goto ky1
txtptr=note2
gosub print3d
cmp note3,0,0,goto ky1
txtptr=note3
gosub print3d
ky1: cmp freturn,0,0,goto ky1a
txtptr=clickany
gosub print3d
goto keyout
ky1a: colour=1
yyval=yyval+10
txtptr=remdsk
gosub print3d
ky2: gosub remm
gosub waitsgn
cmp mess,0,0,goto ky2
cmp numdsk,2,-1,goto bye0
yyval=yyval+10
txtptr=copyrst
gosub print3d
delay(50)
ky3: curdsk=curdsk+1
cmp curdsk,numdsk,1,goto bye0
tensv=curdsk/10&$ffff
onesv=tensv*10
onesv=curdsk-onesv
poke(dskm1,tensv+48)
poke(dskm1+1,onesv+48)
tensv=numdsk/10&$ffff
onesv=tensv*10
onesv=numdsk-onesv
poke(dskm2,tensv+48)
poke(dskm2+1,onesv+48)
docopy=simplereq(cpytitl,nxtdskm)
cmp docopy,1,-1,goto bye0
drivenum=fcopy(connect,-1)
cmp drivenum,0,-1,goto bye0
goto ky3
keyout: gosub remm
gosub waitsgn
cmp mess,0,0,goto keyout
bye0: gosub closwin
byebye: end
errpnf: cmp freturn,0,0,goto errp2
txtptr=pnf1
gosub print3d
goto prii5a
errp2: txtptr=pnf
gosub print3d
goto looper1
remprt: delay(150)
cmp freturn,-1,0,goto bye0
remprta:yyval=yyval+10
txtptr=remdsk
gosub print3d
goto keyout
errfnf: cmp freturn,0,0,goto errf2
txtptr=fnf1
gosub print3d
goto prii5a
errf2: txtptr=fnf
gosub print3d
looper1:pointer=oritab
looper2:orig=^pointer
pointer=pointer+4
fix=^pointer
pointer=pointer+4
pval=^pointer
cmp pval,0,0,top=garbage
cmp pval,0,2,top=pval
pos=dscan(drivenum,orig,fix-orig,fix,top-fix,0,1)
cmp pos,-2,0,goto prii5a
cmp pval,0,2,goto looper2
goto itsok
prii5a: txtptr=pnf2
gosub print3d
goto remprt
errexists:myhand=open(frqpath,1005)
freturn=-1
cmp myhand,0,0,goto errfnf
close(myhand)
txtptr=exist
gosub print3d
goto prii5a
#i "Params:WINHAND"